package com.share.homestay.web;

import com.share.homestay.entity.HostelSystem;
import com.share.homestay.pojo.JsonResult;
import com.share.homestay.service.HostelSystemServiceFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "名宿表")
@RestController
@CrossOrigin
@RequestMapping("HostelSystem")
public class HostelSystemController {
    @Autowired
    private HostelSystemServiceFeign hostelSystemServiceFeign;

    @RequestMapping("findPageHostelSystem")
    @ApiOperation(value = "分页查询名宿信息",httpMethod = "POST",notes = "分页查询名宿信息")
    JsonResult findPageHostelSystem(@RequestBody HostelSystem hostelSystem, @RequestParam(value = "pageNum",defaultValue = "1")Long pageNum, @RequestParam(value = "pageSize",defaultValue = "100")Long pageSize){
        System.out.println(hostelSystem+"dddddddddddddddddddddddddddddddddddd");
        return hostelSystemServiceFeign.findPageHostelSystem(hostelSystem,pageNum,pageSize);
    }

    @RequestMapping("delByIdHostelSystem")
    @ApiOperation(value = "通过Id删除名宿",httpMethod = "GET",notes = "通过Id删除名宿")
    Long delByIdHostelSystem(String id){
        return hostelSystemServiceFeign.delByIdHostelSystem(id);
    }

//    @RequestMapping("getProvince")
//    @ApiOperation(value = "获取省份",httpMethod = "GET",notes = "获取省份")

}
